<template>
  <div id="app">
<!--    <router-view></router-view>-->
    <el-container>

      <el-header ><span style="color:plum">

        <div >
        <el-menu
            :default-active="activeIndex2"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
  <el-menu-item index="1" style="margin-left: 100px">处理中心</el-menu-item>
  <el-submenu index="2" style="margin-left: 50px">
    <template slot="title" >我的工作台</template>
    <el-menu-item index="贷款列表">贷款列表</el-menu-item>
    <el-menu-item index="财务报表图">财务报表图</el-menu-item>
    <el-menu-item index="标的投资">标的投资</el-menu-item>
    <el-submenu index="2-4">
      <template slot="title">消息中心</template>
      <el-menu-item index="贷款日志表">贷款日志表</el-menu-item>
      <el-menu-item index="每日签到">每日签到</el-menu-item>
      <el-menu-item index="系统消息">系统消息</el-menu-item>
    </el-submenu>
  </el-submenu>
  <el-menu-item index="3"  style="margin-left: 50px">抽奖中心</el-menu-item>
  <el-menu-item index="4"  style="margin-left: 50px"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
  <el-menu-item @click="$router.push('/creditLoan')" index="5"  style="margin-left: 50px">信用贷</el-menu-item>
  <el-menu-item @click="$router.push('/userDetails')" index="6"  style="margin-left: 50px">个人中心</el-menu-item>
       <!--登录成功邮箱  -->
      <div style="float:right;margin-top: 15px;margin-right: 100px" @click="toUserDetails">
       <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
      </div>
</el-menu>
     </div>


      </span>
      </el-header>
      <!--   中建部分-->
      <el-container>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>

  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: '1',
      activeIndex2: '1'
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key);
      if(key==='贷款列表'){
        this.$router.push("/BorrowerList")
      }
      if(key=='财务报表图'){
        this.$router.push("/RepaymentEcharts")
      }
    },
    toUserDetails() {
        this.$router.push('/userDetails')
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
